package com.macro.mall.demo.controller;

import com.github.pagehelper.PageHelper;
import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.common.dto.AddressData;
import com.macro.mall.common.dto.IndexDto;
import com.macro.mall.demo.service.EsDocumentService;
import com.macro.mall.demo.service.EsIndexService;
import com.macro.mall.demo.uilt.Mangers;
import com.macro.mall.model.OrderInfo;
import com.macro.mall.model.PmsProduct;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Slf4j
public class EsDocumentController {


    @Autowired
    private EsDocumentService esDocumentService;




    /**
     * 查询
     */
    @PostMapping("/SelBoot")
    public CommonResult<CommonPage<PmsProduct>> selBoot(@Validated  @RequestBody OrderInfo orderInfo) {
        CommonPage<PmsProduct> list = esDocumentService.selBoot(orderInfo);
        return CommonResult.success(list);
    }


    /**
     * 智能搜索
     * 赵王17267365647秀洲区王江泾镇南元丰大道82282700
     */
    @PostMapping("/member/address/seek/{adds}")
    public CommonResult<AddressData> seek(@Validated @PathVariable String adds) {
        AddressData ums = esDocumentService.seek(adds);
        return CommonResult.success(ums);
    }








}
